<?php

$file = $_FILES['qqfile'];

// list of valid extensions, ex. array("jpeg", "xml", "bmp")
$allowedExtensions = array();
// max file size in bytes
$sizeLimit = 10 * 1024 * 1024;

$uploader = new qqFileUploader($allowedExtensions, $sizeLimit);
$result = $uploader->handleUpload(IMAGES);

// to pass data through iframe you will need to encode all html tags
//echo htmlspecialchars(json_encode($result), ENT_NOQUOTES);

echo '{"error":"' . (isset($result["error"]) ? $result["error"] : "") . '","name":"' . $file['name'] . '","type":"' . $file['type'] . '","size":"' . $file['size'] . '"}';
?>